{extend name="base_mobile" /}
{block name="body"}
<header class="hui-header">
    <div id="hui-back"></div>
    <h1>子账户管理</h1>
    <div id="hui-header-menu" onclick="hui.showSlideMenu();"></div>
</header>
<div class="hui-wrap">
    <div style="padding-top:5px;">
        <a href="{:url('user/index/sub_user_add')}" class="hui-button hui-fl hui-danger" style="width:100%"><i class="fa fa-plus-square-o"></i> 新增子账户</a>
    </div>
    <div class="hui-list" style="margin-top:18px;">
        {foreach name="list" item="v" empty="$empty"}
        <?php $shop = app\common\model\Shop::get($v['shop_id']);?>
        <a href="#">
            <div class="hui-list-icons" style="font-size:12px;">
                {if $shop.admin_id == $v.id}
                <span class="hui-badge hui-primary hui-button-small">主</span>
                {else}
                <span class="hui-badge hui-danger hui-button-small">子</span>
                {/if}
            </div>
            <div class="hui-list-text" style="font-weight: bold;">
                {$v.username}
                <div class="hui-list-info">
                    
                    <span class="hui-icons hui-icons-right"></span>
                </div>
            </div>
        </a>
        <a href="#">
            <div style="font-size:13px;color:#898989;padding-left:20px;padding-top:5px;line-height: 22px;">
                {if empty($v.last_login_time)}无{else/}{$v.last_login_time|date='Y-m-d H:i:s', ###}{/if}
                <br>{if $v.status eq 1}启用{else}停用{/if}
            </div>
        </a>
        {if $shop.admin_id != $v.id}
        <div style="padding-top:5px;">
            <a href="{:url('user/index/sub_user_edit', ['id' => $v.id])}" class="hui-button hui-button-small hui-fl" style="width:50%"><i class="fa fa-check-square-o"></i> 编辑</a>
            <a href="{:url('user/index/sub_user_del', ['id' => $v.id])}" class="hui-button hui-button-small hui-fl ajax-delete" style="width:50%"><i class="fa fa-clock-o"></i> 删除</a>
        </div>
        {/if}
        {/foreach}
    </div>
    <div class="page" style="margin-bottom: 70px;">{$list->mobile_render()}</div>
</div>
{/block}